home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / ODCtr.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  5.4 KB  |  242 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: ODCtr.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes used by this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODContainer_xh
  18. #define SOM_ODContainer_xh
  19.  
  20. class ODContainer;
  21.  
  22. #define ODContainer_MajorVersion 1
  23. #define ODContainer_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODRefCntObject_xh
  31. #include <RefCtObj.xh>
  32. #endif
  33.  
  34. #ifndef ODContainer_API
  35. #define ODContainer_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODRefCntObject;
  50. class ODStorageSystem;
  51. class ODContainer;
  52. class ODDocument;
  53.  
  54. /*
  55.  * End of user-defined types.
  56.  */
  57.  
  58. #ifdef OLDIBMSOMAPISUPPORT
  59. #define ODContainerCClassData ODContainerClassData
  60. #define ODContainerNewClass(major,minor) somNewVersionedClassReference(ODContainer,major,minor)
  61. #endif
  62.  
  63. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  64. #define ODContainerMetaClass SOMClass
  65.  
  66. #if PRAGMA_ALIGN_SUPPORTED
  67. #  pragma options align=power
  68. #endif
  69.  
  70. /* The API to the ODContainer class object, and the methods it introduces. */
  71. SOMEXTERN struct ODContainerClassDataStructure {
  72. #ifdef OLDIBMSOMAPISUPPORT
  73.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  74. #else
  75.     long zero;
  76. #endif
  77.     somStaticClassInfo *sci;
  78.     somDToken        instanceDataToken;
  79.     long reserved [3];
  80.     somMToken GetStorageSystem;
  81.     somMToken GetID;
  82.     somMToken GetName;
  83.     somMToken SetName;
  84.     somMToken AcquireDocument;
  85.     somMToken reserved1;
  86.     somMToken reserved2;
  87.     somMToken reserved3;
  88.     somMToken reserved4;
  89.     somMToken reserved5;
  90. } SOMDLINK ODContainerClassData;
  91.  
  92. #if PRAGMA_ALIGN_SUPPORTED
  93. #  pragma options align=reset
  94. #endif
  95.  
  96. #if !defined(ODContainer_Class_Source) && !defined(SOM_Module_odctr_Source)
  97. #if PRAGMA_IMPORT_SUPPORTED
  98. #pragma import list ODContainerClassData
  99. #endif
  100. #endif
  101.  
  102.  
  103. /*
  104.  * -- Typedefs and inline method declarations for left path inherited methods
  105.  * -- are omitted because this compilation had -museinheritedmethods in effect
  106.  */
  107.  
  108.  
  109. /*
  110.  * -- Typedefs for ODContainer Method Procedures
  111.  */
  112. SOMEXTERN {
  113. typedef ODStorageSystem*   (* SOMLINK somTD_ODContainer_GetStorageSystem)(ODContainer *somSelf, Environment *ev);
  114. typedef ODContainerID   (* SOMLINK somTD_ODContainer_GetID)(ODContainer *somSelf, Environment *ev);
  115. typedef ODContainerName   (* SOMLINK somTD_ODContainer_GetName)(ODContainer *somSelf, Environment *ev);
  116. typedef void   (* SOMLINK somTD_ODContainer_SetName)(ODContainer *somSelf, Environment *ev,
  117.         ODContainerName* name);
  118. typedef ODDocument*   (* SOMLINK somTD_ODContainer_AcquireDocument)(ODContainer *somSelf, Environment *ev,
  119.         ODDocumentID id);
  120. }
  121.  
  122. #endif /* ODContainer_API */
  123.  
  124.  
  125. /*
  126.  * -- This emitter treats Method Tokens as Thunks by default.
  127.  * -- Use the sc modifier "nothunks" to change this default
  128.  */
  129. #undef somresolve_
  130. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  131.  
  132. /*
  133.  * -- The C++ Wrapper Class for ODContainer
  134.  */
  135. class ODContainer : public ODRefCntObject
  136. {
  137. public:
  138.  
  139. // ODContainer::new registers use of the class object, and then uses somNew
  140. // to allocate memory and load the object method table pointer. 
  141. void *operator new(size_t size)
  142. {
  143.     SOM_IgnoreWarning(size);
  144.     // Allocate memory using the default allocator for ODContainer, and
  145.     // clear mem & set method table pointer, call basic initialization
  146. #ifdef SOMCHKNULL
  147.     void * __somResult = (void *)
  148.       somNewObject(ODContainer);
  149.     SOMCHKNULL(__somResult);
  150.     return __somResult;
  151. #else
  152.     return (void*) somNewObject(ODContainer);
  153. #endif
  154. }
  155.  
  156. // ODContainer::delete uses the default deallocator for the object's class.
  157. void operator delete(void * obj)
  158. {
  159.     if (obj) {
  160.         SOM_Resolve(obj,SOMObject,somFree)
  161.            ( (SOMObject*) obj );
  162.     }
  163. }
  164.  
  165. /* method: GetStorageSystem */
  166. ODStorageSystem*   GetStorageSystem(Environment *ev)
  167. {
  168.    #ifdef SOMCHKEXCEPT
  169.    ODStorageSystem* __somResult = 
  170.       SOM_ResolveD(this,ODContainer,ODContainer,GetStorageSystem)
  171.     (this,ev);
  172.       SOMCHKEXCEPT;
  173.    return __somResult;
  174. #else
  175.    return SOM_ResolveD(this,ODContainer,ODContainer,GetStorageSystem)
  176.     (this,ev);
  177. #endif
  178. }
  179.  
  180. /* method: GetID */
  181. ODContainerID   GetID(Environment *ev)
  182. {
  183.    #ifdef SOMCHKEXCEPT
  184.    ODContainerID __somResult = 
  185.       SOM_ResolveD(this,ODContainer,ODContainer,GetID)
  186.     (this,ev);
  187.       SOMCHKEXCEPT;
  188.    return __somResult;
  189. #else
  190.    return SOM_ResolveD(this,ODContainer,ODContainer,GetID)
  191.     (this,ev);
  192. #endif
  193. }
  194.  
  195. /* method: GetName */
  196. ODContainerName   GetName(Environment *ev)
  197. {
  198.    #ifdef SOMCHKEXCEPT
  199.    ODContainerName __somResult = 
  200.       SOM_ResolveD(this,ODContainer,ODContainer,GetName)
  201.     (this,ev);
  202.       SOMCHKEXCEPT;
  203.    return __somResult;
  204. #else
  205.    return SOM_ResolveD(this,ODContainer,ODContainer,GetName)
  206.     (this,ev);
  207. #endif
  208. }
  209.  
  210. /* method: SetName */
  211. void   SetName(Environment *ev,
  212.         ODContainerName* name)
  213. {
  214.    SOM_ResolveD(this,ODContainer,ODContainer,SetName)
  215.     (this,ev,name);
  216. #ifdef SOMCHKEXCEPT
  217.       SOMCHKEXCEPT;
  218. #endif
  219. }
  220.  
  221. /* method: AcquireDocument */
  222. ODDocument*   AcquireDocument(Environment *ev,
  223.         ODDocumentID id)
  224. {
  225.    #ifdef SOMCHKEXCEPT
  226.    ODDocument* __somResult = 
  227.       SOM_ResolveD(this,ODContainer,ODContainer,AcquireDocument)
  228.     (this,ev,id);
  229.       SOMCHKEXCEPT;
  230.    return __somResult;
  231. #else
  232.    return SOM_ResolveD(this,ODContainer,ODContainer,AcquireDocument)
  233.     (this,ev,id);
  234. #endif
  235. }
  236.  
  237. };   /* ODContainer */
  238.  
  239.  
  240.  
  241. #endif       /* SOM_ODContainer_xh */
  242.